package com.scenery.serer.services;

import org.jivesoftware.smack.AccountManager;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;

public class UserServices {
	/***用户注册*/
	public static int register(String username,String password)
	{
		ConnectionConfiguration config = new ConnectionConfiguration("192.168.7.51",5222);
		Connection connection = new XMPPConnection(config);
		try {
			connection.connect();
			AccountManager amgr = connection.getAccountManager();
			amgr.createAccount(username, password);
		} catch (XMPPException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 

		return 0;


	}
	public static void main(String args[])
	{
		register("use12","123");
	}
}
